package com.tevintao.marketingsystem.datebase;


import android.content.ContentValues;

import org.json.JSONException;
import org.json.JSONObject;

public class DeviceInfo {


    private String device_name;
    private String device_brand;
    private String device_manufacture;
    private String device_product;
    private String device;
    private String device_type;

    private int width;
    private int height;
    private float device_density;

    private String os_version;
    private String imei;
    private String ua;

    public String getDevice_name() {
        return device_name;
    }

    public void setDevice_name(String device_name) {
        this.device_name = device_name;
    }

    public String getDevice_brand() {
        return device_brand;
    }

    public void setDevice_brand(String device_brand) {
        this.device_brand = device_brand;
    }

    public String getDevice_manufacture() {
        return device_manufacture;
    }

    public void setDevice_manufacture(String device_manufacture) {
        this.device_manufacture = device_manufacture;
    }

    public String getDevice_product() {
        return device_product;
    }

    public void setDevice_product(String device_product) {
        this.device_product = device_product;
    }

    public String getDevice() {
        return device;
    }

    public void setDevice(String device) {
        this.device = device;
    }

    public String getDevice_type() {
        return device_type;
    }

    public void setDevice_type(String device_type) {
        this.device_type = device_type;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public float getDevice_density() {
        return device_density;
    }

    public void setDevice_density(float device_density) {
        this.device_density = device_density;
    }

    public String getOs_version() {
        return os_version;
    }

    public void setOs_version(String os_version) {
        this.os_version = os_version;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getUa() {
        return ua;
    }

    public void setUa(String ua) {
        this.ua = ua;
    }

    public static ContentValues getContentValues(DeviceInfo info) {
        ContentValues contentValues = new ContentValues();
        contentValues.put("device_name", info.device_name);
        contentValues.put("device_brand", info.device_brand);
        contentValues.put("device_manufacture", info.device_manufacture);
        contentValues.put("device_product", info.device_product);
        contentValues.put("device", info.device);
        contentValues.put("device_type", info.device_type);
        contentValues.put("width", info.width);
        contentValues.put("height", info.height);
        contentValues.put("device_density", info.device_density);
        contentValues.put("os_version", info.os_version);
        contentValues.put("imei", info.imei);
        contentValues.put("ua", info.ua);

        return contentValues;
    }

    @Override
    public String toString() {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("device_name", this.device_name);
            jsonObject.put("device_brand", this.device_brand);
            jsonObject.put("device_manufacture", this.device_manufacture);
            jsonObject.put("device_product", this.device_product);
            jsonObject.put("device", this.device);
            jsonObject.put("device_type", this.device_type);
            jsonObject.put("width", this.width);
            jsonObject.put("height", this.height);
            jsonObject.put("device_density", this.device_density);
            jsonObject.put("os_version", this.os_version);
            jsonObject.put("imei", this.imei);
            jsonObject.put("ua", this.ua);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return jsonObject.toString();
    }
}
